package pacmanreturns;

import java.applet.AudioClip;
import java.net.URL;

public class AudioManager {
	AudioClip[] clips;
	String[] files = {
		"sounds/start.wav",
		"sounds/chompdot.wav"
	};
	private boolean chomping = false;

	public AudioManager(Game game) {
		clips = new AudioClip[files.length];
		for (int i = 0; i < files.length; i++) {
			clips[i] = game.getAudioClip(game.getCodeBase(), files[i]);
		}
	}

	public void play(int i) {
		clips[i].play();
	}

	public void chompDot() {
		if (!chomping) {
			clips[1].loop();
			chomping = true;
		}
	}
}